package com.oyjd.business.photo.activity;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.widget.RelativeLayout;

import com.oyjd.R;
import com.oyjd.framework.ui.gallery.GalleryController;
import com.oyjd.framework.ui.gallery.ImageAndText;

public class GalleryActivity extends Activity {

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.gallery_layout);

		com.oyjd.framework.ui.gallery.Gallery gallery = (com.oyjd.framework.ui.gallery.Gallery) findViewById(R.id.middle_huilife_gallery);
		// TextView textView1 = (TextView)acti.findViewById(R.id.label1);
		// TextView textView2 = (TextView)acti.findViewById(R.id.label2);
		RelativeLayout layout = (RelativeLayout) findViewById(R.id.gallery_container);
		GalleryController handler = new GalleryController(gallery); // 添加控制器

		List<ImageAndText> list = new ArrayList<ImageAndText>();

		for (int i = 0; i < 5; i++) {
			list.add(new ImageAndText("http://img.itc.cn/photo/jNwSGFZWXt8", "aaa" + i, "aaa" + i));
		}

		// handler.setTextView(textView1, null); // 设置文字视图，用于显示数据中的文字
		handler.setLayout(layout);
		handler.setData(list);
	}

}
